home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
doom
/
turric03.zip
/
TURRIC03.ZIP
/
PROGS
/
M-DEMON.QC
< prev
next >
Wrap
Text File
|
1997-01-30
|
13KB
|
390 lines
/*
==============================================================================
DEMON MORPH
==============================================================================
*/
$cd /raid/quake/id1/models/demon3
$scale 0.8
$origin 0 0 24
$base base
$skin base
$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9
$frame stand10 stand11 stand12 stand13
$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8
$frame run1 run2 run3 run4 run5 run6
$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 leap10
$frame leap11 leap12
$frame pain1 pain2 pain3 pain4 pain5 pain6
$frame death1 death2 death3 death4 death5 death6 death7 death8 death9
$frame attacka1 attacka2 attacka3 attacka4 attacka5 attacka6 attacka7 attacka8
$frame attacka9 attacka10 attacka11 attacka12 attacka13 attacka14 attacka15
//** PATCH_BEGIN - morph2 - Turrican ****
void(float h_dir, float v_dir) player_demon_melee =
{
local vector source, org;
local vector offang;
local float ldmg;
sound (self, CHAN_WEAPON, "weapons/ax1.wav", 1, ATTN_NORM);
offang = self.v_angle;
offang_y = offang_y + h_dir;
offang_x = offang_x + v_dir;
makevectors (offang);
source = self.origin + '0 0 4';
traceline (source, source + v_forward* 80, FALSE, self);
if (trace_fraction == 1.0)
return;
org = trace_endpos - v_forward*4;
if (trace_ent.takedamage)
{
sound (self, CHAN_WEAPON, "demon/dhit2.wav", 1, ATTN_NORM);
ldmg = 40 + 10*random();
T_Damage (trace_ent, self, self, ldmg);
trace_ent.axhitme = 1;
spawn_touchblood (40);
SpawnMeatSpray (org, v_right * 16);
}
else
{ // hit wall
sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_GUNSHOT);
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
}
};
// left slash attack
void() player_demon_attack_l1 = [$attacka1, player_demon_attack_l2 ] {self.view_ofs = '0 0 8';};
void() player_demon_attack_l2 = [$attacka2, player_demon_attack_l3 ] {self.view_ofs = '0 0 16';};
void() player_demon_attack_l3 = [$attacka3, player_demon_attack_l4 ] {self.view_ofs = '0 0 25';};
void() player_demon_attack_l4 = [$attacka4, player_demon_attack_l5 ] {self.view_ofs = '0 0 23';};
void() player_demon_attack_l5 = [$attacka5, player_demon_attack_l6 ] {self.view_ofs = '0 0 21'; player_demon_melee(20, 10);};
void() player_demon_attack_l6 = [$attacka6, player_demon_attack_l7 ] {self.view_ofs = '0 0 16';};
void() player_demon_attack_l7 = [$attacka7, player_demon_attack_l8 ] {self.view_ofs = '0 0 8';};
void() player_demon_attack_l8 = [$attacka8, player_stand1 ] {self.view_ofs = '0 0 4';};
// right slash attack
void() player_demon_attack_r1 = [$attacka1, player_demon_attack_r2 ] {self.view_ofs = '0 0 8';};
void() player_demon_attack_r2 = [$attacka9, player_demon_attack_r3 ] {self.view_ofs = '0 0 16';};
void() player_demon_attack_r3 = [$attacka10, player_demon_attack_r4 ] {self.view_ofs = '0 0 23';};
void() player_demon_attack_r4 = [$attacka11, player_demon_attack_r5 ] {self.view_ofs = '0 0 21'; player_demon_melee(-20, 10);};
void() player_demon_attack_r5 = [$attacka12, player_demon_attack_r6 ] {self.view_ofs = '0 0 16';};
void() player_demon_attack_r6 = [$attacka13, player_demon_attack_r7 ] {self.view_ofs = '0 0 12';};
void() player_demon_attack_r7 = [$attacka14, player_demon_attack_r8 ] {self.view_ofs = '0 0 8';};
void() player_demon_attack_r8 = [$attacka15, player_stand1 ] {self.view_ofs = '0 0 4';};
// combination l-r slash attack
void() player_demon_attack_lr1 = [$attacka1, player_demon_attack_lr2 ] {self.view_ofs = '0 0 8';};
void() player_demon_attack_lr2 = [$attacka2, player_demon_attack_lr3 ] {self.view_ofs = '0 0 16';};
void() player_demon_attack_lr3 = [$attacka3, player_demon_attack_lr4 ] {self.view_ofs = '0 0 25';};
void() player_demon_attack_lr4 = [$attacka4, player_demon_attack_lr5 ] {self.view_ofs = '0 0 23';};
void() player_demon_attack_lr5 = [$attacka5, player_demon_attack_lr6 ] {self.view_ofs = '0 0 21'; player_demon_melee(20, 10);};
void() player_demon_attack_lr6 = [$attacka6, player_demon_attack_lr7 ] {self.view_ofs = '0 0 23';};
void() player_demon_attack_lr7 = [$attacka7, player_demon_attack_lr8 ] {self.view_ofs = '0 0 24';};
void() player_demon_attack_lr8 = [$attacka8, player_demon_attack_lr9 ] {self.view_ofs = '0 0 25';};
void() player_demon_attack_lr9 = [$attacka9, player_demon_attack_lr10 ] {self.view_ofs = '0 0 24';};
void() player_demon_attack_lr10 = [$attacka10, player_demon_attack_lr11 ] {self.view_ofs = '0 0 23';};
void() player_demon_attack_lr11 = [$attacka11, player_demon_attack_lr12 ] {self.view_ofs = '0 0 21'; player_demon_melee(-20, 10);};
void() player_demon_attack_lr12 = [$attacka12, player_demon_attack_lr13 ] {self.view_ofs = '0 0 16';};
void() player_demon_attack_lr13 = [$attacka13, player_demon_attack_lr14 ] {self.view_ofs = '0 0 12';};
void() player_demon_attack_lr14 = [$attacka14, player_demon_attack_lr15 ] {self.view_ofs = '0 0 8';};
void() player_demon_attack_lr15 = [$attacka15, player_stand1 ] {self.view_ofs = '0 0 4';};
void () player_demon_attack =
{
if (self.weapon == DEMON_SLASH_L)
{
self.attack_finished = time + 0.7;
player_demon_attack_l1();
}
else if (self.weapon == DEMON_SLASH_R)
{
self.attack_finished = time + 0.7;
player_demon_attack_r1();
}
else if (self.weapon == DEMON_SLASH_LR)
{
self.attack_finished = time + 1.4;
player_demon_attack_lr1();
}
};
//** PATCH_END - morph2 - Turrican ******
void() player_demon_jumptouch =
{
local float ldmg;
if(other.takedamage)
{
ldmg = 40 + 10*random();
T_Damage(other, self, self, ldmg);
SpawnMeatSpray (self.origin + v_forward*20, 100* v_forward);
SpawnMeatSpray (self.origin + v_forward*20, 50* v_forward);
}
self.touch = SUB_Null;
};
void() player_demon_jump1 = [ $leap1, player_demon_jump1 ] {
if (self.walkframe >= 12)
self.walkframe = 11;
self.frame = $leap1 + self.walkframe;
self.walkframe = self.walkframe + 1;
if (self.flags & FL_ONGROUND) {
self.touch = SUB_Null;
player_stand1();
}
};
void() player_demon_jump = {
makevectors(self.v_angle);
self.origin_z = self.origin_z + 1;
self.velocity = v_forward * 800 + '0 0 350';
sound(self, CHAN_BODY, "demon/djump.wav", 1, ATTN_NORM);
self.touch = player_demon_jumptouch;
player_demon_jump1();
};
void() player_demon_stand = [ $stand1, player_stand1 ] {
if(self.walkframe >= 13)
self.walkframe=0;
self.frame = $stand1 + self.walkframe;
self.walkframe = self.walkframe + 1;
};
void() player_demon_run = [ $run1, player_run ] {
if(self.walkframe >= 6)
self.walkframe = 0;
self.frame = $run1 + self.walkframe;
self.walkframe = self.walkframe + 1;
};
//** PATCH_BEGIN - morph2 - Turrican ****
/*
void() player_demon_pain = [ $pain5, player_demon_pain1 ]
{
self.walkframe = 1;
PainSound();
self.weaponframe = 0;
self.frame = $pain5;
};
void() player_demon_pain1 = [ $pain1, player_demon_pain1 ]
{
if (self.walkframe >=10)
player_stand1();
if (self.walkframe < 6)
self.frame = $pain5 + self.walkframe;
else self.frame = $pain5 + (10 - self.walkframe);
self.walkframe = self.walkframe + 1;
};
*/
void() player_demon_pain1 =[ $pain1, player_demon_pain2 ] {self.view_ofs = '0 0 8';};
void() player_demon_pain2 =[ $pain2, player_demon_pain3 ] {self.view_ofs = '0 0 16';};
void() player_demon_pain3 =[ $pain3, player_demon_pain4 ] {self.view_ofs = '0 0 24';};
void() player_demon_pain4 =[ $pain4, player_demon_pain5 ] {self.view_ofs = '0 0 16';};
void() player_demon_pain5 =[ $pain5, player_demon_pain6 ] {self.view_ofs = '0 0 10';};
void() player_demon_pain6 =[ $pain6, player_stand1 ] {self.view_ofs = '0 0 4';};
void () player_demon_pain =
{
if (self.touch == player_demon_jumptouch)
return;
if (self.pain_finished > time)
return;
PainSound();
self.pain_finished = time + 0.5;
self.attack_finished = time + 0.5;
player_demon_pain1 ();
};
void() player_demon_impulse =
{
if(self.impulse > 3 && self.impulse < 11)
{
self.impulse = 0;
return;
}
// Choose weapon.
if (self.impulse == 1)
self.weapon = DEMON_SLASH_L;
else if (self.impulse == 2)
self.weapon = DEMON_SLASH_R;
else if (self.impulse == 3)
self.weapon = DEMON_SLASH_LR;
// Cycle weapon.
else if (self.impulse == 11)
{
if (self.weapon == DEMON_SLASH_L)
self.weapon = DEMON_SLASH_R;
else if (self.weapon == DEMON_SLASH_R)
self.weapon = DEMON_SLASH_LR;
else if (self.weapon == DEMON_SLASH_LR)
self.weapon = DEMON_SLASH_L;
}
else if (self.impulse == 12)
{
if (self.weapon == DEMON_SLASH_L)
self.weapon = DEMON_SLASH_LR;
else if (self.weapon == DEMON_SLASH_LR)
self.weapon = DEMON_SLASH_R;
else if (self.weapon == DEMON_SLASH_R)
self.weapon = DEMON_SLASH_L;
}
// Inform player of change.
if (self.weapon == DEMON_SLASH_L)
sprint(self, "Left Slash\n");
else if (self.weapon == DEMON_SLASH_R)
sprint(self, "Right Slash\n");
else if (self.weapon == DEMON_SLASH_LR)
sprint(self, "Combination Slash\n");
self.impulse = 0;
};
void() player_demon_die1 =[ $death1, player_demon_die2 ] {};
void() player_demon_die2 =[ $death2, player_demon_die3 ] {};
void() player_demon_die3 =[ $death3, player_demon_die4 ] {};
void() player_demon_die4 =[ $death4, player_demon_die5 ] {};
void() player_demon_die5 =[ $death5, player_demon_die6 ] {};
void() player_demon_die6 =[ $death6, player_demon_die7 ] {};
void() player_demon_die7 =[ $death7, player_demon_die8 ] {};
void() player_demon_die8 =[ $death8, player_demon_die9 ] {};
void() player_demon_die9 =[ $death9, player_demon_die9 ]
//** PATCH_BEGIN - gibbin3 - Turrican ****
{
PlayerDead();
MakePlayerCorpse (self.max_health * self.health_modifier * 0.65,
'-32 -32 -24', '32 32 -12');
};
//** PATCH_END - gibbin3 - Turrican ******
void () player_demon_die =
{
self.items = self.items - (self.items & IT_INVISIBILITY);
self.invisible_finished = 0; // don't die as eyes
self.invincible_finished = 0;
self.super_damage_finished = 0;
self.radsuit_finished = 0;
self.view_ofs = '0 0 -8';
self.deadflag = DEAD_DYING;
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.movetype = MOVETYPE_TOSS;
if (self.velocity_z < 10)
self.velocity_z = self.velocity_z + random()*300;
//** PATCH_BEGIN - gibbin3 - Turrican ****
// Pass player size and head.mdl to Corpse_die using globals.
self.corpse_size = SIZE_MEDIUM;
self.head_gib_name = "progs/h_demon.mdl";
//** PATCH_END - gibbin3 - Turrican ******
// check for gib
if (self.health < -80)
{
//** PATCH_BEGIN - gibbin3 - Turrican ****
Corpse_die();
//** PATCH_END - gibbin3 - Turrican ******
return;
}
self.angles_x = 0;
self.angles_z = 0;
DeathSound();
// regular death
player_demon_die1 ();
};
//** PATCH_END - morph2 - Turrican ******
string() player_demon_killmsg = { return " was slashed by "; };
string() player_demon_killmsg2 = { return "\n"; };
void() player_demon_become = {
//** PATCH_BEGIN - morph2 - Turrican ****
// bprint(self.netname);
// bprint(" has become a fiend.\n");
sprint( self, "You have become a fiend.\n");
// Stop the morph from flying.
if (self.flags & FL_FLY)
{
localcmd("fly");
self.flags = self.flags - FL_FLY;
}
self._impulse = player_demon_impulse;
self._die = player_demon_die;
//** PATCH_END - morph2 - Turrican ******
self._stand=player_demon_stand;
self._run=player_demon_run;
self._pain=player_demon_pain;
self._jump=SUB_Null;
self._jump2=player_demon_jump;
self._attack=player_demon_attack;
self._can_get_p=SUB_False;
self._killmsg=player_demon_killmsg;
self._killmsg2=player_demon_killmsg2;
setmodel(self,"progs/demon.mdl");
self.modelindex_morph=self.modelindex;
self.weaponmodel="";
//** PATCH_BEGIN - morph2 - Turrican ****
self.view_ofs = '0 0 4';
if(!deathmatch)
setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
else
setsize (self, VEC_HULL2_MIN, '32 32 32');
//** PATCH_END - morph2 - Turrican ******
self.health = self.health * 5.00 / self.health_modifier;
self.health_modifier = 5.00;
makevectors(self.v_angle);
spawn_tfog(self.origin + 20 * v_forward);
DropBackpack2();
//** PATCH_BEGIN - morph2 - Turrican ****
self.currentammo = 0;
self.weapon = DEMON_SLASH_LR;
// Make morphs ignore player colors.
if (self.colormap != 0)
{
self.temp_colormap = self.colormap;
self.colormap = 0;
}
// Make morphs ignore player skins.
if (self.skin != 0)
{
self.temp_skin = self.skin;
self.skin = 0;
}
//** PATCH_END - morph2 - Turrican ******
};